const modules = [
	require.context("pages/vues/", true, /\.vue$/)
];
let components = {};
const ignoreNames = ["login", "register", "forgot-pwd", "dashboard"];

modules.forEach(element => {
	element.keys().forEach(filePath => {
		// 获取组件配置
		let component = element(filePath).default || element(filePath);
		let routeName = component.name;
		if (!components[routeName]) {
			if (ignoreNames.includes(routeName)) {
				components[routeName] = component;
			} else {
				components[routeName] = resolve => require([`@/pages/vues/${filePath.replaceAll("./", "")}`], resolve);
			}
		}
	});
});
export default components;
